﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes.effects {
    import Classes.*;
    import com.greensock.*;

    public class SunriseEffect extends AnimationEffect {

        public function SunriseEffect(_arg1:MapResource, _arg2:String){
            super(_arg1, _arg2);
        }
        override public function cleanUp():void{
            if (m_effectImage){
                TweenLite.killTweensOf(m_effectImage);
                TweenLite.killDelayedCallsTo(m_effectImage);
            };
            super.cleanUp();
        }
        override public function reattach():void{
            var _local1:Number;
            var _local2:Number;
            var _local3:Number;
            var _local4:Number;
            super.reattach();
            if (m_effectImage){
                _local1 = (m_mapResource.content.width >> 1);
                _local2 = (m_mapResource.content.height * 0.33);
                _local3 = -((m_effectImage.width >> 1));
                _local4 = -((m_effectImage.height >> 1));
                m_effectImage.x = ((_local1 + _local3) + m_itemImage.offsetX);
                m_effectImage.y = ((_local2 + _local4) + m_itemImage.offsetY);
                m_effectImage.alpha = 0;
                TweenLite.to(m_effectImage, 1, {
                    alpha:1,
                    y:(m_effectImage.y - 65)
                });
                TweenLite.to(m_effectImage, 0.5, {
                    alpha:0,
                    delay:1.5,
                    overwrite:0,
                    onComplete:this.tweenCompleteHandler
                });
            };
        }
        private function tweenCompleteHandler():void{
            this.cleanUp();
        }

    }
}//package Classes.effects 
